package com.zzyl.nursing.task;

import com.zzyl.nursing.service.IAlertRuleService;
import com.zzyl.nursing.service.IContractService;
import com.zzyl.nursing.service.IDeviceDataService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ContractJob {

    @Autowired
    private IContractService  contractService;

    @Autowired
    private IDeviceDataService deviceDataService;

    @Autowired
    private IAlertRuleService  alertRuleService;

    public void upDateContractStatus () {
        log.info("定时更新合同方法执行了");
        contractService.updateContractStatus();
    }

    public void deleteOnTime () {
        log.info("定时删除数据方法执行了");
        deviceDataService.deleteOnTime();
    }

    /**
     * 设备报警数据定时过滤
     */
    public void deviceDataAlertFilter () {
        log.info("定时过滤设备报警数据方法执行了");
        alertRuleService.alertFilter();
    }
}
